﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
	xmlns:controls="clr-namespace:EarthWatchers.SL.GUI.Controls" mc:Ignorable="d" 
	x:Class="EarthWatchers.SL.GUI.Controls.UserInfo" HorizontalAlignment="Left" VerticalAlignment="Top" Width="140">
	<Border Margin="0" Padding="0" BorderBrush="#FFE7E7E7" BorderThickness="2,2,2,0" RenderTransformOrigin="0,0" HorizontalAlignment="Left" VerticalAlignment="Top" >
		<Grid Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top">			
			<StackPanel Margin="0" Orientation="Vertical" Width="136">
				<Grid x:Name="bgLayerGrid" Height="20" Margin="0" VerticalAlignment="Top">
					<Rectangle Margin="0" Stroke="#FF939393">
						<Rectangle.Fill>
							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
								<GradientStop Color="#FFEFEFEF" Offset="0"/>
								<GradientStop Color="#FFEFEFEF" Offset="1"/>
								<GradientStop Color="#FFB8B8B8" Offset="0.193"/>
							</LinearGradientBrush>
						</Rectangle.Fill>
					</Rectangle>
					<sdk:Label x:Name="label" HorizontalAlignment="Center" Margin="0" Content="User" VerticalAlignment="Center"/>					 
				</Grid>
				<Grid x:Name="GridLogedIn" Margin="0,4" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Collapsed">
					<StackPanel Margin="3,0" d:LayoutOverrides="Width">					
						<StackPanel Orientation="Horizontal" Width="129">
							<Grid x:Name="avatarWrapper" Margin="0" Background="#FFE4E4E4" HorizontalAlignment="Left" VerticalAlignment="Top">
								<Image Margin="1" x:Name="avatar" Stretch="Fill" Width="35" Height="35" VerticalAlignment="Top" HorizontalAlignment="Center"/>
							</Grid>						
							<StackPanel MaxWidth="80" Orientation="Vertical" Margin="4,0,0,0" Width="88">								
                                <HyperlinkButton x:Name="txtLogout" Click="TxtLogoutClick" Content="Logout" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Center" FontSize="10" />
                                <HyperlinkButton x:Name="btnMyLand" Click="BtnMyLandClick" Content="My Land" TargetName="_blank" FontSize="10" HorizontalAlignment="Left" ToolTipService.ToolTip="Take me to my land"/>
                             <StackPanel Margin="0">
                                    <Button x:Name="btnHelp2" Style="{StaticResource ImageButton}" ToolTipService.ToolTip="Help" Margin="0"  HorizontalAlignment="Right" VerticalAlignment="Top" Width="20"  Height="20" Visibility="Visible">
                				<Image x:Name="btnHelp3" MouseLeftButtonDown="BtnHelpMouseLeftButtonDown2" HorizontalAlignment="Left" Source="Resources/Images/questionmark.png" Stretch="Fill" Width="20" Margin="1" Height="20"/>
                				</Button>
                              </StackPanel>
                            </StackPanel>					
						</StackPanel>																
					</StackPanel>
				</Grid>
                <Grid x:Name="GridLoading" Margin="0,4" VerticalAlignment="Top" Visibility="Collapsed">
					<StackPanel Margin="3,0" d:LayoutOverrides="Width">
						<TextBlock Margin="0,0,12,0" TextWrapping="Wrap" Text="Loading Profile" HorizontalAlignment="Center" FontSize="10.667"/>
						<ProgressBar Margin="0,2,0,5" VerticalAlignment="Center" IsIndeterminate="True" Height="14" HorizontalAlignment="Center" Width="115"/>
					</StackPanel>
				</Grid>
				<Grid x:Name="GridNoUser" Margin="0,4">
                    <StackPanel Orientation="Vertical" Height="90" VerticalAlignment="Top">
                        <StackPanel Orientation="Vertical" Margin="3">
                            <TextBox x:Name="tbUsername" Text="TIG username" FontSize="10" Height="24" Margin="5,0,5,0" GotFocus="TbUsernameGotFocus" />
                            <PasswordBox x:Name="tbAuthkey" FontSize="10" Height="24" Margin="5,3,5,0" GotFocus="TbAuthkeyGotFocus"  />
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="7,2,7,0">
                                <TextBlock x:Name="txtIncorrectLogin" Text="Incorrect login" HorizontalAlignment="Center" FontSize="9" Visibility="Collapsed" Foreground="Red" Margin="0,0,7,0"/>
                                <HyperlinkButton x:Name="btnLogin" Click="BtnLoginClick" Content="Login" HorizontalAlignment="Right" Margin="0,0,0,0" VerticalAlignment="Center" FontSize="9" />
                            </StackPanel>
                        </StackPanel>
					    <StackPanel Margin="3,0" d:LayoutOverrides="Width" HorizontalAlignment="Center">					
						    <TextBlock x:Name="txtUsername1" Margin="0" Visibility="Collapsed" TextWrapping="Wrap" Text="Username not found" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="9" Foreground="#FFEEEEEE"/>
                            <HyperlinkButton x:Name="btnBecomeEarthwatcher" TargetName="_blank" NavigateUri="http://deforestaction.org" Content="Become an Eartwatcher" Margin="0,1,0,0" FontSize="9" Height="15" HorizontalAlignment="Center"/>					
					    </StackPanel>
                    </StackPanel>
                </Grid>			
			</StackPanel>
		</Grid>
	</Border>
</UserControl>